package com.xyz.tasks.properties;

import org.apache.ibatis.session.ExecutorType;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.io.Resource;

/**
 * <p>
 * 功能概述:
 * </p>
 * <p>
 * 功能详述:
 * </p>
 */
@Configuration
@PropertySource("classpath:mybatis.properties")
@ConfigurationProperties(prefix = MybatisProperties.MYBATIS_PREFIX)
public class MybatisProperties {
    /*========================================================================*
     *                         Public Fields (公共属性)
     *========================================================================*/
    public static final String MYBATIS_PREFIX = "mybatis";
    /*========================================================================*
     *                         Private Fields (私有属性)
     *========================================================================*/

    /** * Config file path. */
    private String config;

    /** * Location of mybatis mapper files. */
    private Resource[] mapperLocations;

    /** * Package to scan domain objects. */
    private String typeAliasesPackage;

    /** * Package to scan handlers. */
    private String typeHandlersPackage;

    /** * Check the config file exists. */
    private boolean checkConfigLocation = false;

    /** * Execution mode. */
    private ExecutorType executorType = ExecutorType.SIMPLE;

    /*========================================================================*
     *                         Construct Methods (构造方法)
     *========================================================================*/

    /*========================================================================*
     *                         Public Methods (公有方法)
     *========================================================================*/

    public String getConfig() {
        return config;
    }

    public void setConfig(String config) {
        this.config = config;
    }

    public Resource[] getMapperLocations() {
        return mapperLocations;
    }

    public void setMapperLocations(Resource[] mapperLocations) {
        this.mapperLocations = mapperLocations;
    }

    public String getTypeAliasesPackage() {
        return typeAliasesPackage;
    }

    public void setTypeAliasesPackage(String typeAliasesPackage) {
        this.typeAliasesPackage = typeAliasesPackage;
    }

    public String getTypeHandlersPackage() {
        return typeHandlersPackage;
    }

    public void setTypeHandlersPackage(String typeHandlersPackage) {
        this.typeHandlersPackage = typeHandlersPackage;
    }

    public boolean isCheckConfigLocation() {
        return checkConfigLocation;
    }

    public void setCheckConfigLocation(boolean checkConfigLocation) {
        this.checkConfigLocation = checkConfigLocation;
    }

    public ExecutorType getExecutorType() {
        return executorType;
    }

    public void setExecutorType(ExecutorType executorType) {
        this.executorType = executorType;
    }

    /*========================================================================*
     *                         Private Methods (私有方法)
     *========================================================================*/
}
